package monopoly;

class community_chest{
    public static void player(){
         
                /* add random number generator
        *  not implemented:     You are assessed for street repairs  $40 per house, $115 per hotel
        *  get out of jail free
        */                     
                dice.community_chest(vars.chance);              
                if(vars.chance==1){
                        System.out.println("Advance to Go");
                        System.out.println("You advance to go and collect $200");
                        vars.player_position=0;
                        vars.player_money=vars.player_money+200;
                }
                if(vars.chance==2){
                        System.out.println("Bank error in your favor. Collect $200");
                        System.out.println("You collect $200");
                        vars.player_money=vars.player_money+200;
                }
                if(vars.chance==3){
                        System.out.println("Doctor's fees - Pay $50");
                        System.out.println("You pay $50");
                        vars.player_money=vars.player_money-50;
                }
                if(vars.chance==4){
                        System.out.println("Go to jail");
                        vars.player_position=10;
                        vars.player_jail=1;
                }
                if(vars.chance==5){
                        System.out.println("It is your birthday - Collect $10 from each player");
                        System.out.println("You collect $10 from the computer");
                        vars.player_money=vars.player_money+10;
                        vars.computer_money=vars.computer_money-10;
                }
                if(vars.chance==6){
                        System.out.println("Grand Opera Night - Collect $50 from each player");
                        System.out.println("You collect $50 from the computer");
                        vars.player_money=vars.player_money+50;
                        vars.computer_money=vars.computer_money-50;
                }
                if(vars.chance==7){
                        System.out.println("Income tax refund - Collect $20");
                        System.out.println("You collect $20");
                        vars.player_money=vars.player_money+20;
                }
                if(vars.chance==8){
                        System.out.println("Life Insurance Matures - Collect $100");
                        System.out.println("You collect $100");
                        vars.player_money=vars.player_money+100;
                }
                if(vars.chance==9){
                        System.out.println("Pay Hospital Fees of $100");
                        System.out.println("You pay $100");
                        vars.player_money=vars.player_money-100;
                }
                if(vars.chance==10){
                        System.out.println("Pay School Fees of $50");
                        System.out.println("You pay $50");
                        vars.player_money=vars.player_money-50;
                }
                if(vars.chance==11){
                        System.out.println("Receive $25 Consultancy Fee");
                        System.out.println("You collect $25");
                        vars.player_money=vars.player_money+25;
                }
                if(vars.chance==12){
                        System.out.println("You have won second prize in a beauty contest  collect $10");
                        System.out.println("You collect $10");
                        vars.player_money=vars.player_money+10;
                }
                if(vars.chance==13){
                        System.out.println("You inherit $100");
                        System.out.println("You collect $100");
                        vars.player_money=vars.player_money+100;
                }
                if(vars.chance==14){
                        System.out.println("From sale of stock you get $50");
                        System.out.println("You collect $50");
                        vars.player_money=vars.player_money+50;
                }
                if(vars.chance==15){
                        System.out.println("Holiday Fund matures - Receive $100");
                        System.out.println("You collect $100");
                        vars.player_money=vars.player_money+100;
                }
        }
    
        public static void computer(){
                //insert random number generator
                if(vars.chance==1){
                        System.out.println("Advance to Go");
                        System.out.println("The Computer advances to go and collects $200");
                        vars.computer_position=0;
                        vars.computer_money=vars.computer_money+200;
                }
                if(vars.chance==2){
                        System.out.println("Bank error in your favor. Collect $200");
                        System.out.println("The Computer collects $200");
                        vars.computer_money=vars.computer_money+200;
                }
                if(vars.chance==3){
                        System.out.println("Doctor's fees - Pay $50");
                        System.out.println("The Computer pays $50");
                        vars.computer_money=vars.computer_money-50;
                }
                if(vars.chance==4){
                        System.out.println("Go to jail");
                        System.out.println("The Computer goes to Jail");
                        vars.computer_position=10;
                        vars.computer_jail=1;
                }
                if(vars.chance==5){
                        System.out.println("It is your birthday - Collect $10 from each player");
                        System.out.println("The Computer collects $10 from you");
                        vars.player_money=vars.player_money-10;
                        vars.computer_money=vars.computer_money+10;
                }
                if(vars.chance==6){
                        System.out.println("Grand Opera Night - Collect $50 from each player");
                        System.out.println("The Computer collects $50 from you");
                        vars.player_money=vars.player_money-50;
                        vars.computer_money=vars.computer_money+50;
                }
                if(vars.chance==7){
                        System.out.println("Income tax refund - Collect $20");
                        System.out.println("The Computer collects $20");
                        vars.computer_money=vars.computer_money+20;
                }
                if(vars.chance==8){
                        System.out.println("Life Insurance Matures - Collect $100");
                        System.out.println("The Computer collects $100");
                        vars.computer_money=vars.computer_money+100;
                }
                if(vars.chance==9){
                        System.out.println("Pay Hospital Fees of $100");
                        System.out.println("The Computer pays $100");
                        vars.computer_money=vars.computer_money-100;
                }
                if(vars.chance==10){
                        System.out.println("Pay School Fees of $50");
                        System.out.println("The Computer pays $50");
                        vars.computer_money=vars.computer_money-50;
                }
                if(vars.chance==11){
                        System.out.println("Receive $25 Consultancy Fee");
                        System.out.println("The Computer collects $25");
                        vars.computer_money=vars.computer_money+25;
                }
                if(vars.chance==12){
                        System.out.println("You have won second prize in a beauty contest collect $10");
                        System.out.println("The Computer collects $10");
                        vars.computer_money=vars.computer_money+10;
                }
                if(vars.chance==13){
                        System.out.println("You inherit $100");
                        System.out.println("The Computer collects $100");
                        vars.computer_money=vars.computer_money+100;
                }
                if(vars.chance==14){
                        System.out.println("From sale of stock you get $50");
                        System.out.println("The Computer collects $50");
                        vars.computer_money=vars.computer_money+50;
                }
                if(vars.chance==15){
                        System.out.println("Holiday Fund matures - Receive $100");
                        System.out.println("The Computer collects $100");
                        vars.computer_money=vars.computer_money+100;
                }
        }
}